﻿using CanDoo.Core.Logging;
using CanDoo.Core.Security;
using CanDoo.Data;
using CanDoo.Utility;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace CanDoo.Oil.WebHost
{
    public partial class test : FineUI.PageBase
    {
        private static long machineId;//机器ID
        private static long datacenterId = 0L;//数据ID
        private static long sequence = 0L;//计数从零开始

        //唯一时间随机量 //  1970年=687888001020L; 2000年=523494260170L  2016年8月1日=172390299L
        private static long twepoch = 172390299L;//(long)(firstDay - default(DateTime)).TotalMilliseconds; 

        private static long machineIdBits = 5L; //机器码字节数
        private static long datacenterIdBits = 5L;//数据字节数
        public static long maxMachineId = -1L ^ -1L << (int)machineIdBits; //最大机器ID
        private static long maxDatacenterId = -1L ^ (-1L << (int)datacenterIdBits);//最大数据ID

        public IOperateLoger OperateLoger { get; set; }

        protected void Page_Load(object sender, EventArgs e)
        {
            Response.Write( ClaimsUtility.GetFromClame("test") );

            //Response.Write("<br />");
            //Response.Write(IdMaker.NewId());
            //Response.Write("<br />");

            //Response.Write(IdMaker.MachineId);
            //Response.Write("<br />");

            //Response.Write(IdMaker.DatacenterId);
            //Response.Write("<br />");

            //Response.Write(IdMaker.LastTimestamp);
            //Response.Write("<br />");


            //OperateLoger.FunctionInfo = new FunctionInfo { DataLogEnabled = true, OperateLogEnabled = true, ModuleName="test", PageCode="test", PowerCode="test", PowerName="test" };
            //OperateLoger.OperationResult = OperationResult.Success;
            //OperateLoger.SaveLog();

        }
    }
}